﻿#region
/* ===============================================
 * 作者：guopeng           时间：2012/5/5 15:28:14
 * 
 * 
 * 类描述：
 * 
 * 
 * =============================================== */
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ueEngine.Biz.Inf.Entities;
using ueEngine.Biz.Inf.LogicEntity.SupportData;
using ueEngine.Biz.Inf.Entities.DBSupport;

namespace ueEngine.Biz.Inf.LogicEntity
{
    public class TalentModel : IAccessible<Talent,TalentModel>
    {
        #region self
        public int Id { get; set; }

        /// <summary>
        /// 招募者
        /// </summary>
        public string Recruiter { get; set; }

        public int ResumeId { get; set; }
        #endregion

        #region resume
        /// <summary>
        /// 简历单
        /// </summary>
        public ResumeSheetModel Resume { get; set; }
        #endregion

        #region user
        public MemberModel Seeker { get; set; }
        #endregion

        protected override void Covariant(Talent dbModel)
        {
            Id = dbModel.Id;
            Recruiter = dbModel.Recruiter;
            ResumeId = dbModel.ResumeId;
            
        }
        protected override Talent Inverter(TalentModel model)
        {
            return new Talent()
            {
                Id = model.Id,
                Recruiter = model.Recruiter,
                ResumeId = model.ResumeId
            };
        }
        //public override TalentModel Element(System.Linq.Expressions.Expression<Func<Talent, bool>> where)
        //{
        //    Covariant(new Talent().Get(where));
        //    return this;
        //}
        //public override List<TResult> Elements<TResult>(System.Linq.Expressions.Expression<Func<Talent, bool>> where, System.Linq.Expressions.Expression<Func<Talent, TResult>> select)
        //{
        //    using (Context ctx = new Context())
        //    {
        //        return ctx.Talent.Where(where).Select(select).ToList();
        //    }
        //}
    }
}
